<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <span id="spanTime"></span>
    <script>
        //现在是 2020年04月21日 15:04:20 星期二
        setInterval(function () {
            var now = new Date();
            var year = now.getFullYear()
            var month = now.getMonth() + 1;
            var date = now.getDate();
            var hours = now.getHours();
            var minutes = now.getMinutes();
            var seconds = now.getSeconds();
            var week = now.getDay();// 0~6
            var weekArray = ['星期天', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']
            var timeString = '现在是 ' + year + '年' + month + '月' + date + '日 '
                + hours + ':' + minutes + ':' + seconds + ' ' + weekArray[week];
            spanTime.innerText = timeString;
        }, 1000);
        // 'a' + 'b' => 'ab'
    </script>
</body>

</html>